package cn.ucox.web.ms.controller;


import cn.ucox.web.ms.view.ApiResult;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.Map;
import cn.ucox.web.ms.service.IRkkService;

import static org.springframework.web.bind.annotation.RequestMethod.GET;
import static org.springframework.web.bind.annotation.RequestMethod.POST;

/**
 * Created by caobo on 2017/7/8.
 */
@Controller
@RequestMapping(value = "MainApi")
public class RkkController {

    @Resource
    private IRkkService  iRkkService;

    @ResponseBody
    @RequestMapping(value = "version", method = GET)
    public ApiResult version()
    {
        String version="0.01";
        return  new ApiResult<Object>().success(version);
    }

    @ResponseBody
    @RequestMapping(value = "rkk", method = POST)
    public Map<String, Object> gotoRKK(HttpServletRequest request)
    {
        String username = request.getParameter("username");
        String idnum = request.getParameter("idnum");
        return iRkkService.getAuthication(username,idnum);
    }
}
